package com.kexinde.wjifen.vo;

import javax.persistence.Entity;

/**
 * 分页信息,用于action与jsp页面
 * @author vincent
 *
 */
@Entity
public class PageInfo {
	/**
	 * 要分页的表名,(不建议使用)
	 */
	private String table;
	
	/**
	 * 当前页,初始值为第一页
	 */
	private int currentPage=1;
	
	/**
	 * 每页显示的记录数,根据需要自定义
	 */
	private int lineSize;
	
	/**
	 * 此表可分得的总页数,通过查询数据库计算得出
	 */
	private int pageAmount;
	
	/**
	 * 此表的总记录数，通过查询数据库得出
	 */
	private int amount;
	
	
	/**
	 * 构造函数
	 * 用于第一次分页时人工构造
	 * @param currentPage
	 * @param lineSize
	 */
	public PageInfo(int currentPage, int lineSize) {
		super();
		this.currentPage = currentPage;
		this.lineSize = lineSize;
	}
	
	

	public PageInfo() {
		super();
	}



	public String getTable() {
		return table;
	}
	
	public void setTable(String table) {
		this.table = table;
	}
	
	public int getCurrentPage() {
		return currentPage;
	}
	
	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}
	
	public int getLineSize() {
		return lineSize;
	}
	
	public void setLineSize(int lineSize) {
		this.lineSize = lineSize;
	}
	
	public int getPageAmount() {
		return pageAmount;
	}
	
	public void setPageAmount(int pageAmount) {
		this.pageAmount = pageAmount;
	}
	
	public int getAmount() {
		return amount;
	}

	public void setAmount(int amount) {
		this.amount = amount;
	}



	@Override
	public String toString() {
		return "PageInfo [table=" + table + ", currentPage=" + currentPage
				+ ", lineSize=" + lineSize + ", pageAmount=" + pageAmount
				+ ", amount=" + amount + "]";
	}
	
	

	
}
